<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sys_menus', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('parent_id')->nullable()->default(0)->comment('父级菜单ID');
            $table->boolean('always_show')->nullable()->comment('是否一直显示');
            $table->string('name')->nullable()->comment('菜单名称');
            $table->string('icon')->nullable()->comment('icom');
            $table->string('route_name')->nullable()->comment('路由名称');
            $table->string('route_path')->nullable()->comment('路由相对路径');
            $table->string('component')->nullable()->comment('组件路径');
            $table->boolean('sort')->nullable()->comment('菜单排序，越小越靠前');
            $table->boolean('visible')->nullable()->comment('菜单是否可见1 显示 0隐藏');
            $table->string('redirect')->nullable()->comment('跳转路径');
            $table->string('type')->nullable()->comment('菜单类型 NULL MENU  CATALOG  EXTLINK BUTTON');
            $table->string('perm')->nullable()->comment('按钮权限标识');
            $table->boolean('keep_alive')->nullable()->comment('页面缓存');
            $table->string('params', 1000)->nullable();
            $table->dateTime('create_time')->nullable();
            $table->dateTime('update_time')->nullable();
            $table->dateTime('deleted_at')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sys_menus');
    }
};
